//
// Created by Kobe LI on 16/4/21.
// Copyright (c) 2016 bao. All rights reserved.
//

#import <Foundation/Foundation.h>

//获取手机验证码
static NSString *url_net_get_phone_code = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=code";

//注册
static NSString *url_net_register = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=n_register";

//登录
static NSString *url_net_login = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=n_verify";

//第三方注册登录
static NSString *url_net_thirdpart_login = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=n_openidverify";

//第三方绑定手机号
static NSString *url_net_thirdpart_binding = @"http://www.ctdsb.net/index.php?m=app&c=n_index&a=binding";

//查询用户信息
static NSString *url_net_get_user = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=n_userinfo";

//修改用户信息
static NSString *url_net_edit_user = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=editinfo";

//修改用户头像
static NSString *url_net_edit_usericon = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=upimg";

//我的福利
static NSString *url_net_my_fuli = @"http://www.ctdsb.net/index.php?m=app&c=fuli&a=myfuli";

//输入邀请码领福利
static NSString *url_net_input_fuli_code = @"http://www3.ctdsb.net/index.php?m=app&c=fuli&a=joinfuli";

//个人中心封面
static NSString *url_user_center_cover = @"http://www3.ctdsb.net/index.php?m=app&c=index&a=setTopPic&id=5";

//首页头部图片
static NSString *url_home_top_bar = @"http://www3.ctdsb.net/index.php?m=app&c=index&a=setTopPic&id=6";

//检查手机号
static NSString *url_check_mobile = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=checkmobile";
//发送手机验证码
static NSString *url_forgot_code = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=code";
//修改密码
static NSString *url_modify_password = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=editpass";

@interface ServiceUser : NSObject

/**
 *  获取验证码
 *
 *  @param phoneNum_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doGetPhoneCode:(NSString *)phoneNum_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;


/**
 *  注册
 *
 *  @param phoneNum_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doRegister:(NSString *)phoneNum_
                              password:(NSString *)password_
                              code:(NSString *)code_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

/**
 *  检查手机号
 *
 *  @param phoneNum_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)checkMobile:(NSString *)phoneNum_
                              success:(void (^)(id responseObject,NSString *message))success_
                              failure:(void (^)(NSString *message))failure_;

/**
 *  发送验证码
 *
 *  @param phoneNum_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)sendForgotCode:(NSString *)phoneNum_
                              success:(void (^)(id responseObject,NSString *message))success_
                              failure:(void (^)(NSString *message))failure_;

/**
 *  修改密码
 *
 *  @param userid_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doEditUserPassword:(NSString *)phoneNum_
                                password:(NSString *)password_
                                code:(NSString *)code_
                                 success:(void (^)(id responseObject,NSString *message))success_
                                 failure:(void (^)(NSString *message))failure_;

/**
 *  登录
 *
 *  @param phoneNum_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doLogin:(NSString *)phoneNum_
                            password:(NSString *)password_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

/**
 *  第三方注册登录
 *
 *  @param openid_
 *  @param typeid_ 第三方类型（1：qq; 2:weibo; 3:weixin）
 *  @param imgpath_ 头像路径
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doThirdPartLogin:(NSString *)openid_
                                  nickname:(NSString *)nickname_
                                    typeid:(NSString *)typeid_
                                   imgpath:(NSString *)imgpath_
                                   success:(void (^)(id responseObject,NSString *message))success_
                                   failure:(void (^)(NSString *message))failure_;


/**
 *  查询用户信息
 *
 *  @param userid_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doGetUserInfo:(NSString *)userid_
                                   success:(void (^)(id responseObject,NSString *message))success_
                                   failure:(void (^)(NSString *message))failure_;


/**
 *  修改用户信息
 *
 *  @param userid_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doEditUserInfo:(NSString *)userid_
                                nickname:(NSString *)nickname_
                                 success:(void (^)(id responseObject,NSString *message))success_
                                 failure:(void (^)(NSString *message))failure_;
/**
 *  修改用户头像
 *
 *  @param userid_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doEditUserIcon:(NSString *)userid_
                                img_file:(NSString *)img_file_
                                 success:(void (^)(id responseObject,NSString *message))success_
                                 failure:(void (^)(NSString *message))failure_;

/**
 *  修改绑定手机号
 *
 *  @param userid_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doThirdPartBindingPhone:(NSString *)userid_
                                         phoneNum:(NSString *)phoneNum_
                                             code:(NSString *)code_
                                         password:(NSString *)pwd_
                                success:(void (^)(id responseObject,NSString *message))success_
                                failure:(void (^)(NSString *message))failure_;

/**
 *  我的福利
 *
 *  @param userid_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doGetMyFuLi:(NSString *)userid_
                            pageindex:(NSInteger)pageindex_
                             pagesize:(NSInteger)pagesize_
                              success:(void (^)(id responseObject,NSString *message))success_
                              failure:(void (^)(NSString *message))failure_;


/**
 *  输入邀请码领福利
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doInputFuliCode:(NSString *)userid_
                            recode:(NSString *)recode_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

/**
 *  个人中心封面
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doGetUserCenterCover:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;

/**
 *  个人中心封面
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doGetHomeTopBar:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;
@end
